Error detection and handling of a storage system is an important part of storage management. Take small computer system interface (SCSI), as an example, it is a communication protocol widely used in the storage field. SCSI on LINUX platform has a three-layer implementation. The upper layer acts as a model for different types of SCSI devices (for example, magnetic disk, magnetic tape or optical drive). The lower layer, as host bus adapter (HBA) hardware, is usually provided by the HBA vendor. The mid layer, as core layer of SCSI, is responsible for SCSI device scanning, command scheduling and error handling. One of the SCSI command errors is command timeout, that is, the storage device cannot return any response until timeout occurs. Such kind of command timeout happens due to many kinds of reasons and is difficult to handle due to lack of relevant information. In the traditional solution, on one hand, error handling lacks adaptability, and thus it is rather time-consuming. On the other hand, supplier-specific or protocol-specific error handling approach, though effective in shortening error handling time, lacks universality.